<?php
$text = "
	<form name=\"search\" action=\"\" method=\"post\">
		<center>
			<input name=\"keyword\" size=\"60\" type=\"text\" value=\"\">
			<input type=\"submit\" value=\"Ieškoti\">
		</center>
	</form>
	<br>
	<center>
		<a href=\"".url('p,A')."\">A</a>&nbsp;-&nbsp;
		<a href=\"".url('p,B')."\">B</a>&nbsp;-&nbsp;
		<a href=\"".url('p,C')."\">C</a>&nbsp;-&nbsp;
		<a href=\"".url('p,D')."\">D</a>&nbsp;-&nbsp;
		<a href=\"".url('p,E')."\">E</a>&nbsp;-&nbsp;
		<a href=\"".url('p,F')."\">F</a>&nbsp;-&nbsp;
		<a href=\"".url('p,G')."\">G</a>&nbsp;-&nbsp;
		<a href=\"".url('p,H')."\">H</a>&nbsp;-&nbsp;
		<a href=\"".url('p,I')."\">I</a>&nbsp;-&nbsp;
		<a href=\"".url('p,J')."\">J</a>&nbsp;-&nbsp;
		<a href=\"".url('p,K')."\">K</a>&nbsp;-&nbsp;
		<a href=\"".url('p,L')."\">L</a>&nbsp;-&nbsp;
		<a href=\"".url('p,M')."\">M</a>&nbsp;-&nbsp;
		<a href=\"".url('p,N')."\">N</a>&nbsp;-&nbsp;
		<a href=\"".url('p,O')."\">O</a>&nbsp;-&nbsp;
		<a href=\"".url('p,P')."\">P</a>&nbsp;-&nbsp;
		<a href=\"".url('p,Q')."\">Q</a>&nbsp;-&nbsp;
		<a href=\"".url('p,R')."\">R</a>&nbsp;-&nbsp;
		<a href=\"".url('p,S')."\">S</a>&nbsp;-&nbsp;
		<a href=\"".url('p,T')."\">T</a>&nbsp;-&nbsp;
		<a href=\"".url('p,U')."\">U</a>&nbsp;-&nbsp;
		<a href=\"".url('p,V')."\">V</a>&nbsp;-&nbsp;
		<a href=\"".url('p,W')."\">W</a>&nbsp;-&nbsp;
		<a href=\"".url('p,X')."\">X</a>&nbsp;-&nbsp;
		<a href=\"".url('p,Y')."\">Y</a>&nbsp;-&nbsp;
		<a href=\"".url('p,Z')."\">Z</a>
	</center>
	<br>
	<center>
		<table>
			<tr>
";
			$sql = mysql_query("SELECT * FROM `link` LIMIT 30");
			$a = 0;
			while ($row = mysql_fetch_assoc($sql)) {				if ($a != 3) {					$text .= "
						<td><a href='".url("cat," . $row['url'] ."")."'>" . $row['pav'] ."</a></td>
						<td width='5%'></td>
					";
					$a++;
				}
				if ($a == 3) {					$text .= "</tr><tr>";
					$a = 0;
				}
			}

$text .= "
			</tr>
		</table>
	</center>
";
lentele("Katalogų paieška",$text);
unset($a,$text,$row);
if(isset($url['p']) && !empty($url['p'])) { $link_page = $url['p']; }
$link_page = $page{0};
if (!empty($link_page)) {	$result = mysql_query("SELECT * FROM `link_pages` WHERE `char`=" . escape($link_page) ." ORDER BY click");
	if (!$result) { $text = "<center>Atsiprašome, pasirinktame puslapyje adresų nėra</center>"; }
	if ($result) {		$a = 1;		while ($row = mysql_fetch_assoc($result)) {			$text = "
				<table width=100% border=0>
					<tr>
						<td valign='top'>$a</td>
						<td><a href='http://" . $row['url'] ."'>" . $row['pav'] ."</a></td>
					</tr>
					<tr>
						<td></td>
						<td>" . $row['desc'] ."</td>
					</tr>
					<tr>
						<td></td>
						<td><a href='http://" . $row['url'] ."'>" . $row['url'] ."</td>
					</tr>
				</table>
			";
			$a++;
		}
	}
	lentele("Rezultatai",$text);
}
unset($text,$sql,$row,$link_page);
?>